function appointaddnode() {
    let text = document.querySelectorAll('text');
    let showcircle = document.querySelectorAll('.showcircle');
    let showarrow = document.querySelectorAll('.showarrow');

    let location = prompt('请输入你要添加节点的位置数');
    if (location >= showcircle.length || location < 0) {
        location = prompt('输入错误，请再次输入你要添加节点的位置数');
    }
    let num = prompt('请输入你要添加的节点的号数');

    let showtext = text[0].cloneNode(true);
    let node = svg.children[2].cloneNode(true);
    let line = svg.children[3].cloneNode(true);


    let x1 = showcircle[location].getAttribute('x');
    let x2 = text[location].getAttribute('x');

    for (let i = location; i < showcircle.length; i++) {
        let x = showcircle[i].getAttribute('x');
        console.log(parseInt(i) + 1);
        console.log(text[parseInt(i) + 1]);
        console.log(text[parseInt(i) + 1].getAttribute('x'));
        let tx = text[parseInt(i) + 1].getAttribute('x');
        showcircle[i].setAttribute('x', parseInt(x) + 3 * r);
        text[parseInt(i) + 1].setAttribute('x', parseInt(tx) + 3 * r);
        if (i != showcircle.length - 1) {
            showarrow[i].setAttribute('x', parseInt(x) + 4 * r);
        }
    }
    showtext.innerHTML = num;


    node.setAttribute('x', parseInt(x1));
    line.setAttribute('x', parseInt(x1) + 1 * r);
    showtext.setAttribute('x', parseInt(x2) + 3 * r);

    svg.insertBefore(line, showcircle[location]);
    svg.insertBefore(node, showcircle[location]);
    svg.insertBefore(showtext, showcircle[location]);
}